package com.example.dellpc.myapplication;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.baoyz.swipemenulistview.SwipeMenuAdapter;

import java.util.List;

/**
 * Created by 刘智强 on 2016/8/8.
 */
public class SwipeAdapter extends VHAdapter{





    public SwipeAdapter(Activity c) {
        super(c);



    }


    @Override
    protected View createItemView(int position) {

        View v=null;
        v=LayoutInflater.from(mContext).inflate(R.layout.listview_item,null,false);
        return v;
    }

    @Override
    protected VH createViewHolder(int position) {

        return new ViewHolder();
    }


    public  class ViewHolder extends  VH{
         TextView textView;

        @Override
        public void setupViewItem(View v, int position) {
            if (v==null){
                v=LayoutInflater.from(mContext).inflate(R.layout.listview_item,null,false);

            }else {
                textView= (TextView) v.findViewById(R.id.tv_name);


            }

        }

        @Override
        public void fillViewItem(Object obj, int position) {
            String s= (String) obj;
           textView.setText(s);

        }
    }
}
